import Mock from 'mockjs'
import MockList from './MockList'

const data = Mock.mock({
  'items|30': [{
    id: '@id',
    title: '@sentence(10, 20)',
    'status|1': ['published', 'draft', 'deleted'],
    author: 'name',
    display_time: '@datetime',
    pageviews: '@integer(300, 5000)'
  }]
})

export default [
   /**********  数据采集  **********/
  {
    url: '/Mocks/news/list',
    type: 'post',
    response: config => {
      const items = MockList.imageText
      return {
        status: 1,
        data: {
          total: items.length,
          list: items,
          msg: '请求成功'
        }
      }
    }
  },
  {
    url: '/Mocks/list/imageList',
    type: 'post',
    response: config => {
      const items = MockList.imageList
      return {
        status: 1,
        data: {
          total: items.length,
          list: items,
        },
        msg: '请求成功'
      }
    }
  },
  {
    url: '/Mocks/media/list/web',
    type: 'post',
    response: config => {
      const items = MockList.htmlList
      return {
        status: 1,
        total: items.length,
        data: items,
        msg: '请求成功'
      }
    }
  },
  {
    url: '/Mocks/list/fileList',
    type: 'post',
    response: config => {
      const items = MockList.fileList
      return {
        status: 1,
        total: items.length,
        data: items,
        msg: '请求成功'
      }
    }
  },
  {
    url: '/Mocks/list/voiceList',
    type: 'post',
    response: config => {
      const items = MockList.voiceList
      return {
        status: 1,
        total: items.length,
        data: items,
        msg: '请求成功'
      }
    }
  },
  {
    url: '/Mocks/list/videoList',
    type: 'post',
    response: config => {
      const items = MockList.videoList
      return {
        status: 1,
        total: items.length,
        data: items,
        msg: '请求成功'
      }
    }
  },
  {
    url: '/Mocks/list/dataAudit',
    type: 'post',
    response: config => {
      const items = MockList.dataAudit
      return {
        status: 1,
        total: items.length,
        data: items,
        msg: '请求成功'
      }
    }
  },
  /**********  中控模块  **********/
  {
    url: '/Mocks/list/material',
    type: 'post',
    response: config => {
      const items = MockList.material
      return {
        status: 1,
        total: items.length,
        data: items,
        msg: '请求成功'
      }
    }
  },
  /**********  终端管理  **********/
  {
    url: '/Mocks/list/software',
    type: 'post',
    response: config => {
      const items = MockList.software
      return {
        status: 1,
        total: items.length,
        data: items,
        msg: '请求成功'
      }
    }
  },
  {
    url: '/Mocks/list/hardware',
    type: 'post',
    response: config => {
      const items = MockList.software
      return {
        status: 1,
        total: items.length,
        data: items,
        msg: '请求成功'
      }
    }
  },
  /**********  终端管理  **********/
  {
    url: '/Mocks/list/terminalListWX',
    type: 'post',
    response: config => {
      const items = MockList.terminalListWX
      return {
        status: 1,
        total: items.length,
        data: items,
        msg: '请求成功'
      }
    }
  },
]
